<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>新用户注册</title>
		<style type="text/css">
			.error{
				color:red;
			}
			.suc{
				color: green;
				content:'ok';
			}
		</style>
		<script type="text/javascript" src="../day13/jquery-3.2.1.min.js" ></script>
		<script>
			$(function(){
				$(":submit").click(function(){
					 
					var u=document.getElementById("userName");//$("#userName").get(0);
					if(u.validity.valueMissing==true)
					{
						u.setCustomValidity("大哥哥，用户名你必须填");
						
					}
					if(u.validity.patternMismatch==true)
					{
						u.setCustomValidity("请按照字母开头，后面是数字或者字符或者_组成的4-16个字符的格式");
						 
					}
					 
				});
			});
		</script> 
	</head>
	<body>
		<h1>青鸟论坛用户登录</h1>
		<form action="http://i.bdqn.cn/reg-email" method="get" >
			<p>
				
				<label>用户名</label><input type="text" name="userName" id="userName" required pattern="[a-zA-Z]\w{3,15}"/><span></span>
			</p>
			<p>
				<label>密码</label><input id="userpass" type="password" name="userpass" /><span></span>
			</p>
			<p>
				<label>确认密码</label><input type="password" name="repeatpass" id="repeatpass"/>
			</p>
			<p>
				<label>age</label><input type="text" oncontextmenu="return false;" name="age" id="age"/>
			</p>
			<p>
				<label>电邮</label><input type="text" name="myemail" id="myemail"  /><span></span>
			</p>
			<p>
				<input type="submit" value="注册"/>
			</p>
		</form>
	</body>
</html>
